<?php

namespace Zilla\FrontBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

use Doctrine\Common\Collections\ArrayCollection;

/**
 * Zilla\FrontBundle\Entity\Country
 *
 * @ORM\Table(name="country")
 * @ORM\Entity(repositoryClass="Zilla\FrontBundle\Entity\CountryRepository")
 */
class Country
{

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * Bidirectional 
     * 
     * @var ArrayCollection $cities
     *
     * @ORM\OneToMany(targetEntity="City", cascade={"all"}, mappedBy="country")
     */
    private $cities;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Country
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Get cities
     *
     * @return ArrayCollection
     */
    public function getCities()
    {
        return $this->cities;
    }

    /**
     * Set cities
     *
     * @param ArrayCollection $cities
     * @return Country
     */
    public function setCities(ArrayCollection $cities)
    {
        $this->cities = $cities;

        return $this;
    }
    
    /**
     * Add city
     *
     * @param City $city
     */
    public function addCity(City $city)
    {
        $this->cities->add($city);
    }

}
